<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>

<%@ page isELIgnored="false"%>

<!DOCTYPE html>
<html lang=it>

<head>
<title>Nuovo Post</title>
<meta charset="UTF-8">
<jsp:include page="partials/stylesheetChooser.jsp" />
</head>

<body>

	<jsp:include page="partials/header.jsp" />

	<div class="content">
		<div class="add-discussion-page-title">Nuovo Post</div>

		<form name="input" method="post" class="add-discussion-form"
			action="${pageContext.request.contextPath}/forum">
			<label>Titolo</label> <br> <input name="title" type="text"
				size="40" maxlength="200" /> <br> <label>Contenuto</label> <br>
			<textarea name="content" rows="15" cols="50"></textarea>
			<br> Stile <select name="styles">
				<option value="Seleziona stile">Seleziona stile</option>
				<option value="main.css">default</option>
				<c:forEach items="${styles}" var="style">
					<c:set var="cssName"
						value="${fn:substringBefore(style.name, '.css')}" />
					<option value="${style.name}">${cssName}</option>
				</c:forEach>
				<br>
				<input type="submit" value="Invia">
		</form>

		<div>
			<a href="/login-in-prestito/forum">Torna indietro</a>
		</div>
</body>

</html>